import java.util.Scanner;

public class 打印空心正方体 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入正方形边长");
        int 边长 = scanner.nextInt();

        for (int i = 1;i <= 边长;i++){
            for (int j = 1;j <= 边长; j++){
                if(i > 1 && i < 边长){
                    if(j > 1 && j < 边长){
                        System.out.print("   ");
                    }
                    else{
                        System.out.print(" * ");
                    }
                }
                else{
                    System.out.print(" * ");
                }
            }
            System.out.println(" ");
        }
    }
}